<?php

/**
 * Created by JetBrains PhpStorm.
 * User: xaviet
 * Date: 10/3/13
 * Time: 2:44 PM
 * To change this template use File | Settings | File Templates.
 */
class HSCommon {
    public static function indexArray($arr) {
        $result = array();
        foreach ($arr as $i) {
            $result[] = $i;
        }
        return $result;
    }

    public static function getCurrentDay() {
        $day = date("l", time());
        switch ($day) {
            case "Monday":
                $name = "Thứ hai";
                $enum = DayEnum::monday;
                break;
            case "Tuesday":
                $name = "Thứ ba";
                $enum = DayEnum::tuesday;

                break;
            case "Wednesday":
                $name = "Thứ tư";
                $enum = DayEnum::wednesday;
                break;
            case "Thursday":
                $name = "Thứ năm";
                $enum = DayEnum::thursday;
                break;
            case "Friday":
                $name = "Thứ sáu";
                $enum = DayEnum::friday;
                break;
            case "Saturday":
                $name = "Thứ bảy";
                $enum = DayEnum::saturday;
                break;
            case "Sunday":
                $name = "Chủ nhật";
                $enum = DayEnum::sunday;
                break;
            default:
                $name = '';
                $enum = DayEnum::all;
                break;
        }
        return array('enum' => $enum, 'name' => $name);
    }
}
